<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib prefix="s" uri="/struts-tags"%>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>欢迎登陆轻松办公系统</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <script type="text/javascript" src="js/libs/jquery/1.6/jquery.min.js"></script>
     <script type="text/javascript" src="js/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
     <link rel="stylesheet" href="css/min.css" />
     <script type="text/javascript" src="js/min.js"></script>
     <script type="text/javascript" src="content/settings/main.js"></script>
	<link rel="stylesheet" href="content/settings/style.css" />
 </head>
 <body>
  <div class="settings" id="settings">
        <div class="wrapper">
            <div class="grid3">
                <div class="titre">背景色</div>
                <a href="url(css/img/bg.html" class="backgroundChanger active" title="White"></a>
                <a href="url(css/img/dark-bg.html" class="backgroundChanger dark" title="Dark"></a>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
        </div>
        <a class="settingbutton" href="#"></a>
    </div>        
         <!--              
                HEAD
        --> 
        <!--==================================登录头部分显示的部分（信息）============================================-->
        <div id="head">
            <div class="left">
                <a href="#" class="button profile"><img src="img/icons/top/huser.png" alt="" /></a>
                	你好：
                <a href="#">${sessionScope.user1.user_loginName }</a>
                &nbsp;||&nbsp;
                <a href="userAction_logout" onclick="return confirm('确定注销系统吗？')">注销</a>
            </div>
            <div class="right">
                <form action="#" id="search" class="search placeholder">
                    <label>你要找的东西 ?</label>
                    <input type="text" value="" name="q" class="text"/>
                    <input type="submit" value="rechercher" class="submit"/>
                </form>
            </div>
        </div>
        <!--=============================== 左侧要显示的数据（菜单）====================================  -->
        <div id="sidebar">
        	<ul>
        		<li>
        			<a href="${pageContext.request.contextPath }/index.jsp"><img src="${pageContext.request.contextPath }/img/icons/menu/home.png" alt="" />返回首页</a>
        		</li>
      			<s:iterator value="#application.topPowerList">
	      			<s:if test="#session.user1.hasPowerByName(power_name)">
		       			<li>
		       			<a href="#"><img src="img/icons/menu/${power_name }.png" alt="" />${power_name }</a>
		                    <ul>
		                    	<s:iterator value="power_children">
			                    	<s:if test="#session.user1.hasPowerByName(power_name)">
			                        		<li>
			                        			<a href="${pageContext.request.contextPath }${power_url }">${power_name }</a>
			                        		</li>
			                        </s:if>
		              			</s:iterator>
		                    </ul>
		                 </li>
		            </s:if>
	            </s:iterator>
        	</ul>
        </div>       
        <!--            
              CONTENT 
        --> 
        <!-- ===================================中间显示的部分（主体）========================================= -->
		
		<div id="content" class="white">
			   <div class="bloc">
			   <div class="title"></div>
			    <div class="content dashboard">
			        <div class="center" style="text-align: center;">
			            <a href="linkAction_list" class="shortcut">
			                <img src="img/contact.png" alt="" width="48" height="48"/>
			                通讯录
			            </a>
			            <a href="usermarkAction_list?unique_id=${sessionScope.user1.unique_id }" class="shortcut last">
			                <img src="img/page.png" alt="" width="48" height="48" />
			                我的便签
			            </a>
			            <a href="forum_queryAllForum.action?type=0" class="shortcut">
			                <img src="img/baohu.ico" alt="" width="48" height="48" />
			                论坛板块
			            </a>
			            <a href="applicationAction_list" class="shortcut">
			                <img src="img/rutun.ico" alt="" width="48" height="48" />
			                起草申请
			            </a>
			            <a href="applicationAction_myApplicationList" class="shortcut last">
			                <img src="img/liuchen.ico" alt="" width="48" height="48" />
			                申请列表
			            </a>
			            <a href="applicationAction_myTaskList" class="shortcut last">
			                <img src="img/icon.png" alt="" width="48" height="48" />
			                待我审批
			            </a>
			            <a href="#" class="shortcut last">
			                <img src="img/dep.ico" alt="" width="48" height="48" />
			                我的邮件
			            </a>
			            <a href="#" class="shortcut last">
			                <img src="img/user.ico" alt="" width="48" height="48" />
			                我的任务
			            </a>
			            <div class="cb"></div>
			        </div>
			        <p></p>
			    </div>
			</div>  
			<div class="bloc">
			    <div class="title">
			       	 用户列表
			    </div>
			    <div class="content">
			        <table>
			            <thead>
			                <tr>
			                    <th>登录名</th>
				                <th>姓名</th>
				                <th>性别</th>
				                <th>所属部门</th>
				                <th>岗位</th>
				                <th>注册时间</th>
				                <th>备注</th>
				                <th>相关操作</th>
			                </tr>
			            </thead>
			            <tbody>
			                <c:forEach var="userList" items="${requestScope.userList }">
								<tr>
									<td>${userList.user_loginName}</td>
					                <td>${userList.user_name}</td>
					                <td>${userList.user_gender}</td>
					                <td>${userList.department.department_name}</td>
					                <td>
					                	<c:forEach items="${userList.postSet }" var="postSet">
					                		${postSet.post_name}
					                	</c:forEach>
					                </td>
					                <td>${userList.user_regisTime}</td>
					                <td>${userList.user_description}</td>
				                    <td class="actions">
				                    <s:iterator value="#application.topPowerList">
										<s:if test="#session.user1.hasPowerByName(power_name)">
											<s:iterator value="power_children">
												<s:if test="#session.user1.hasPowerByName(power_name)">
													<s:iterator value="power_children">
														<s:if test="#session.user1.hasPowerByName(power_name)">
															<s:if test="power_name=='初始化密码'">
																<a href="userAction_initPassword?unique_id=${userList.unique_id}" onclick="return window.confirm('您确定要初始化密码为123456吗？')" title="初始化密码">
										                    		<img src="img/icons/actions/settings.png" alt="初始化密码" />
										                    	</a>
															</s:if>
															<s:if test="power_name=='用户修改'">
																<a href="userAction_updatePage?unique_id=${userList.unique_id}" title="修改">
										                    		<img src="img/icons/actions/edit.png" alt="修改" />
										                    	</a>
															</s:if>
															<s:if test="power_name=='用户删除'">
																<a href="userAction_delete?unique_id=${userList.unique_id}" onclick="return confirm('确定删除吗？')" title="删除">
										                    		<img src="img/icons/actions/delete.png" alt="删除" />
										                    	</a>
															</s:if>
														</s:if>
													</s:iterator>		
												</s:if>
											</s:iterator>
										</s:if>
									</s:iterator>
				                    </td>
								</tr>
								</c:forEach>
								<tr style="text-align: right;">
									<td colspan="9">
										<div class="submit" style="text-align: center;">
										<s:iterator value="#application.topPowerList">
											<s:if test="#session.user1.hasPowerByName(power_name)">
												<s:iterator value="power_children">
													<s:if test="#session.user1.hasPowerByName(power_name)">
														<s:iterator value="power_children">
															<s:if test="#session.user1.hasPowerByName(power_name)">
																<s:if test="power_name=='用户添加'">
																	<input style="width: 200px;" type="button" class="white" onclick="javascript:location.href='${pageContext.request.contextPath}/userAction_addPage'" value="添加用户"/>
																</s:if>
															</s:if>
														</s:iterator>		
													</s:if>
												</s:iterator>
											</s:if>
										</s:iterator>
					        			</div>
									</td>
								</tr>
				         </tbody>
			        </table>
			     </div>
			  </div>
		  </div>       
</body>
</html>